package com.partvoyage.client.mvp2.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.partvoyage.shared.InfoPointBean;

public class LoadDataInformationPointEvent
		extends
		GwtEvent<LoadDataInformationPointEvent.LoadDataInformationPointEventHandler> {
	public static Type<LoadDataInformationPointEventHandler> TYPE = new Type<LoadDataInformationPointEventHandler>();

	public enum TYPE_INFORMATION_POINT {
		TYPE_ALL, TYPE_NETTOYAGE
	}

	public interface LoadDataInformationPointEventHandler extends EventHandler {
		void onLoadDataInformationPoint(LoadDataInformationPointEvent event);
	}

	private TYPE_INFORMATION_POINT typeInformation;
	private InfoPointBean infoPointBean;

	public LoadDataInformationPointEvent(InfoPointBean infoPointBean,
			TYPE_INFORMATION_POINT typeInformation) {
		this.typeInformation = typeInformation;
		this.infoPointBean = infoPointBean;
	}

	public LoadDataInformationPointEvent(TYPE_INFORMATION_POINT typeInformation) {
		this.typeInformation = typeInformation;
		this.infoPointBean = null;
	}

	public TYPE_INFORMATION_POINT getTypeInformation() {
		return typeInformation;
	}

	public InfoPointBean getInfoPointBean() {
		return infoPointBean;
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<LoadDataInformationPointEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(LoadDataInformationPointEventHandler handler) {
		handler.onLoadDataInformationPoint(this);

	}
}
